<div class="ztkluykes">
<h2><?php __('Chỉ tiêu sản xuất kinh doanh lũy kế');?></h2>
<?php 
            echo '<h3>'.$kh['Donvi']['tendv'].'<br></h3>';
            echo '<h4>';
 
            echo $kh['Thoigian']['tentg'];
            echo ' Từ:'.$kh['Thoigian']['ngaybd'].' đến '.$kh['Thoigian']['ngaykt'].'</h4>';
    ?>

<p>
<?php
echo $paginator->counter(array(
'format' => __('Gồm %count% sản phẩm', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
	
	<th><?php echo $paginator->sort('Tên hàng','tenhh');?></th>
	
	<th><?php echo $paginator->sort('Lũy kế tuần N','kqban_n');?></th>
	<th><?php echo $paginator->sort('Kế hoạch tuần N','chitieu_n');?></th>
    <th><?php echo $paginator->sort('% hoàn thành','chitieu_n');?></th>
	<th><?php echo $paginator->sort('Lũy kế Tháng','kqban_n');?></th>
	<th><?php echo $paginator->sort('Kế hoạch Tháng','chitieu_n');?></th>
    <th><?php echo $paginator->sort('% hoàn thành','chitieu_n');?></th>
	
	</tr>
<?php
$i = 0;
foreach ($ztkluykes as $ztkluyke):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
	
		<td>
			<?php echo $ztkluyke['Ztkluyke']['tenhh']; ?>
		</td>
	   	<td>
			<?php 
                $ban_tuan=0;
                if(!empty( $ztkluyke['Ztkluyke']['kqban_n']))
                    $ban_tuan=$ztkluyke['Ztkluyke']['kqban_n'];
                echo $ban_tuan;
            
             ?>
		</td>
		<td>
			<?php echo $ztkluyke['Ztkluyke']['chitieu_n']; ?>
		</td>
        <td>
        <?php
        if(empty($ztkluyke['Ztkluyke']['chitieu_n'])||$ztkluyke['Ztkluyke']['chitieu_n']==0)
               echo 0;
        else
                echo ($ban_tuan/$ztkluyke['Ztkluyke']['chitieu_n']*100).'%';         
        ?></td>
	   	<td>
			<?php 
                $ban_thang=0;
                if(!empty( $ztkluyke['Ztkluyke']['ban_t']))
                    $ban_thang=$ztkluyke['Ztkluyke']['ban_t'];
                echo $ban_thang;
            ?>
		</td>
		<td>
			<?php echo $ztkluyke['Ztkluyke']['kh_t']; ?>
		</td>
	
	   <td>
        <?php
            if($ztkluyke['Ztkluyke']['kh_t']==0)
                echo 0;
            else
                echo ($ban_thang/$ztkluyke['Ztkluyke']['kh_t']*100).'%';         
        ?></td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>

